package srpingmvc;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class HelloControllerBean {

    //    使用 Servlet 原生 API 实现
    @RequestMapping("/requestParamBean")
    public ModelAndView getParam(User user, HttpServletRequest request,
                                 HttpServletResponse response) {
        System.out.println("Spring RequestParam 传参方式");
        System.out.println(user.getUserName());
        System.out.println(user.getPassword());
        return null;
    }
}
